<template>
    <FormRender :renders="RenderFuncs" :form :initValue @submit="onSubmit" @failed="onFailed" @inited="onInited" debug />
</template>

<script setup>
    import { watch, ref, onMounted } from 'vue'
    import '@arco-design/web-vue/dist/arco.css'

    import { FormRender, RenderFuncs } from "@grid-form/render-arco"
    import { renderProps } from "."

    import { useData } from 'vitepress'

    const props = defineProps(renderProps)

    const { isDark } = useData()

    const changeDark = ()=>{
        if(isDark.value===true)
            document.body.setAttribute('arco-theme', 'dark')
        else
            document.body.removeAttribute('arco-theme')
    }
    watch(isDark, changeDark)

    onMounted( changeDark )
</script>
